package com.q.springboot.framework.util;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

/**
 * @author qmf
 * @date 2022年01月24日 11:14
 * @description
 */
@Data
@AllArgsConstructor
public class RedisSupplier<T> {
    private int expire;
    private TimeUnit timeUnit;
    Supplier<T> supplier;

    public T get() {
        return supplier.get();
    }

    public RedisSupplier(Supplier<T> supplier) {
        this.supplier = supplier;
    }
}
